<template>
  <!--编辑活动-->
  <div>
    <carousel :autoplaySpeed="autoplaySpeed" :Img="Img"></carousel>
    <v_menu :title="data.title" :site="data.list[activeIndex].list"></v_menu>

    <Row :gutter="16" class="wrapper">
      <i-col span="19" class="content">
        <div class="activity" v-for="activity in activity">
          <Row :gutter="16">
            <i-col span="5">
              <div class="industry">
                <router-link class="a" :to="{path:'textCompile', query:{id:activity.id,activeIndex: activeIndex }}">
                  <img v-if="activity.phoneUri" :src="activity.phoneUri" alt="">
                  <img v-else src="../../assets/img/zanwu.png" alt="">
                </router-link>
              </div>
            </i-col>
            <i-col span="19">
              <div class="particulars">
                <h2>
                  <router-link :to="{path:'textCompile', query:{id:activity.id,activeIndex: activeIndex }}" class="a">
                    {{activity.title}}
                  </router-link>
                </h2>
                <p class="p1">{{activity.newsIntro}}</p>
                <p class="p2">{{activity.createTime}}</p>
              </div>
            </i-col>
          </Row>
        </div>
      </i-col>
      <i-col span="5" class="navigation">
        <ngn :data="data" :activeIndex="activeIndex"></ngn>
      </i-col>
    </Row>
    <!--Vue组件-->
    <div class="page">
      <paging :all="all" @returnValue="returnValue"></paging>
    </div>
  </div>
</template>

<script>
  import carousel from '../module/carousel'
  import ngn from '../module/ngn'
  import lesson from '../module/lesson'
  import paging from '../module/paging'
  import v_menu from '../module/menu'

  export default {
    components: {carousel, ngn, lesson, paging, v_menu},
    data() {
      return {
        activeIndex: 0,
        autoplaySpeed: 100000,
        editingActivityLink: this.$api.url + '/news/list/all/activity/',
        all: 1,
        cur: 1,
        Img: [
          {
            id: 1,
            imageLocation: require('../../assets/img/u69.jpg'),
            state: true,
            uri: "",
          },
        ],
        data: {
          title: '编辑之家',
          list: [
            {list: '编辑活动', link: 'editingActivity'},
            {list: '文章资讯', link: 'actciles'},
            {list: '线上课程', link: 'onlineCourses2'},
            {list: '政策法规', link: 'policiesRegulations'},
            {list: '特别策划', link: 'SpecialPlanning'},
          ],
        },
        activity: [],
      }
    },
    mounted() {
      this.dataArray()
    },
    methods: {
      returnValue(data) {
        this.cur = data;
        this.dataArray()
      },
      dataArray() {
        this.$axios.get(this.editingActivityLink + this.cur).then((res) => {
          this.activity = res.data.data.lists;
          this.all = res.data.data.totalPage;
        });
      },
    },
  }
</script>

<style scoped>
  /*主要内容*/
  .wrapper .content {
    border-right: 1px solid #ccc;
    min-height: 300px;
  }

  .wrapper .navigation {
    padding-left: 0 !important;
  }

  .wrapper .content .activity .industry .a img {
    width: 100%;
    height: 150px;
  }

  .wrapper .content .particulars {
    padding-top: 10px;
  }

  .wrapper .content .particulars .a {
    color: #000;
  }

  .wrapper .content .particulars .p1 {
    padding: 10px 0;
    font-size: 15px;
  }

  .wrapper .content .particulars .p2 {
    font-size: 15px;
  }
</style>

